/**
 * Copyright 2002 Cordys R&D B.V. 
 * 
 * This file is part of the Cordys .NET Connector. 
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <stdio.h>
#include <time.h>
#include <glib.h>
#include <xmlLib.h>

#ifdef HASH_ELEMENT
#include "phjLib.h"
#endif /* HASH_ELEMENT */
#include "Managed.h"

 

/*************************************************************************************
  Function Declarations defined in ConverstionLib.These functions are used for 
  converting from both managed data to unmanaged and vice-versa.
*************************************************************************************/
void ReleasePINPointer(void *);
int GetByteLength(String __gc *);
Byte GetByteFromStr(String __gc * Mstring)__gc[];
Int32 GetByteFromChar(const char* srcChar ,Byte destinationBytes[],int charLength );
unsigned char __gc * GetUTF8CharForStr(String *);
unsigned char __gc * GetUTF8CharForStr(String __gc * Mstring);
String __gc * GetUTF8String(unsigned char prefix __gc[]);
String * GetStrFromByteArray(Byte  dataBytes __gc[]);


/************************************************************************************
	Class Defintion of 
		1. XMLException Class
		2. NodeType Class
		3. DataType Class
		3. CompoundType Class	
************************************************************************************/
namespace com
{
  namespace eibus
	{
	namespace xml
		{
		namespace nom
			{
				/********************************************************
					XMLException for raising the Exceptions that are 
					thrown from the NOM layer
				********************************************************/
				public __gc class XMLException : public System::Exception 
				{
				public :
					XMLException::XMLException():Exception()
					{
					}
					

					XMLException::XMLException(String* errorString):Exception(errorString){
					}
					
				};

				/**********************************************************************
					NodeType Declaration. Conatins the mapping values for the Node
					Type.
				**********************************************************************/				
				public __gc class NodeType
					{
						 private :NodeType()
								  {
								  }
						public :
							static const Int32 ELEMENT = 8;
							static const Int32 DTD = 9;
							static const Int32 DATA = 16;
							static const Int32 PI = 18;
					};//End of NodeType Class

				/***********************************************************************
					NodeObject is Class reperesentation of the Node.
				***********************************************************************/
				public __gc class NodeObject
				{
						private :
							Int32 node;

						public :
							NodeObject(Int32 node);
							Int32 GetNode();
							Int32 StopTracking();	 
				};

				/***********************************************************************
					DataType is a Class Containg the Constants determining the datatype 
					of an XML Node of type PCDATA.					
				***********************************************************************/
				public __gc class DataType
				{
					private: DataType()
							 {
							 }
							 
					public :
							static const Int32 XML_NULL = 0;
							static const Int32 XML_STRING = 1;
							static const Int32 I1 = 2;
							static const Int32 UI1 = 3;
							static const Int32 I2 = 4;
							static const Int32 UI2 = 5;
							static const Int32 I4 = 6;
							static const Int32 UI4 = 7;
							static const Int32 I8 = 8;
							static const Int32 UI8 = 9;
							static const Int32 R4 = 10;
							static const Int32 R8 = 11;
							static const Int32 BOOLEAN = 12;
							static const Int32 DATETIME = 13;
							static const Int32 DATETIME_TZ = 14;
							static const Int32 DATE = 15;
							static const Int32 TIME = 16;
							static const Int32 TIME_TZ = 17;
							static const Int32 FIXED = 18;
							static const Int32 BIN_BASE_64 = 19;
				};//End of DataType class

				/***********************************************************************
					CompoundType is a Class Containg the Constants determining the 
					compound Type of an XML Node of type PCDATA.
				***********************************************************************/
				public __gc class CompoundType
				{
						public :
							static const Int32 BASE = 0;
							static const Int32 ARRAY = 1;
							static const Int32 ELEMENTS = 2;
							static const Int32 ENUM = 3;
				};//End of CompoundType
			}//End of nom namespace
		}//End of xml namespace		
	}//End of eibus namespace
}//End of com namespace